// pages/myaudio/audio.js
Page({
    onLoad:function(e){
        const innerAudioContext = wx.createInnerAudioContext({
            useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动，默认关闭。对于短音频、播放频繁的音频建议开启此选项，开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长，因此对于长音频建议关闭此选项
        })
        this.setData({
            myplayer:innerAudioContext
        })

    },
    onReady: function (e) {

    },
    data: {
        myplayer:null,
        poster: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000',
        name: '此时此刻',
        author: '许巍',
        src: 'https://www.syrkitty.com/music/audio/11.mp3',
    },
    audioPlay: function () {
        console.log(this.data.myplayer)
        this.data.myplayer.src = this.data.src
        this.data.src = this.data.src
        this.data.myplayer.play() // 播放
    },
    audioPause: function () {
        this.data.myplayer.pause()
    },
    audio14: function () {
        this.data.myplayer.seek(14)
    },
    audioStart: function () {
        this.data.myplayer.seek(0)
    }
})